import { legacy_createStore, combineReducers, applyMiddleware, compose } from "redux";
import reduxThunk from 'redux-thunk'
import NumStatusReducer from "./NumStatus/reducer";
import ArrStatusReducer from "./ArrStatus/reducer";
// import reducer from './reducer.ts'
/* import { store } from '@/store';
组合各个reducer */
const reducers = combineReducers({
    NumStatusReducer,
    ArrStatusReducer
})



// 创建数据仓库，第二项为配置项,浏览器工具显示（redux-devtools）
// const store = legacy_createStore(reducers, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__())

/*  redux-thunk 
    判断有没有window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__这个模块
*/
let composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({}) : compose
// 仓库数据，浏览器redux-dev-tools，还有reduxThunk关联在store中
const store = legacy_createStore(reducers, composeEnhancers(applyMiddleware(reduxThunk)))
export default store